<template>
	<view class="device-base-info">
		<!-- 姓名 -->
		<view class="username cell-item">
			<view>设备编号</view>
			<view class="right-content">{{deviceEntity.deviceNumber||'--'}}</view>
		</view>
		<!-- 邮箱 -->
		<view class="email cell-item">
			<view>设备名称</view>
			<view class="right-content">{{deviceEntity.deviceName||'--'}}</view>
		</view>
		<!-- 手机号 -->
		<view class="telPhone cell-item">
			<view>规格型号</view>
			<view class="right-content">{{deviceEntity.model||'--'}}</view>
		</view>
		<!-- 角色 -->
		<view class="role cell-item">
			<view>主体材料</view>
			<view class="right-content">{{deviceEntity.material||'--'}}</view>
		</view>
		<!-- 商家名称 -->
		<view class="regitster-info cell-item">
			<view>合同日期</view>
			<view class="right-content"><uni-dateformat :date="deviceEntity.contractTime" format='yyyy-MM-dd'></uni-dateformat></view>
		</view>
		<!-- 商家地区 -->
		<view class="regitster-info cell-item">
			<view>结束日期</view>
			<view class="right-content"><uni-dateformat :date="deviceEntity.endTime" format='yyyy-MM-dd'></uni-dateformat></view>
		</view>
		<!-- 商户描述 -->
		<view class="regitster-info cell-item">
			<view>设备数量</view>
			<view class="right-content">{{deviceEntity.number||'--'}}</view>
		</view>
		<view class="regitster-info cell-item">
			<view>制造状态</view>
			<view class="right-content">
			{{deviceEntity.manufacturingStatus==0?'未开始':(deviceEntity.manufacturingStatus==1?'执行中':(deviceEntity.manufacturingStatus==2?'逾期':(deviceEntity.manufacturingStatus==3?'制造完成':'已发货')))}}
			</view>
		</view>
		<view class="regitster-info cell-item">
			<view>图纸状态</view>
			<view class="right-content">
				{{deviceEntity.drawStatus==0?'设计中':(deviceEntity.drawStatus==1?'审核中':(deviceEntity.drawStatus==2?'已审核':'终版'))}}
			</view>
		</view>
		<view class="regitster-info cell-item">
			<view>工艺文件状态</view>
			<view class="right-content">{{deviceEntity.documentStatus==0?'编辑中':(deviceEntity.documentStatus==1?'已审核':'终版')}}</view>
		</view>
		<view class="regitster-info cell-item" style="border-bottom: none;">
			<view>交工资料状态</view>
			<view class="right-content">{{deviceEntity.handoverStatus==0?'收集中':(deviceEntity.handoverStatus==1?'编辑中':(deviceEntity.handoverStatus==2?'审核中':(deviceEntity.handoverStatus==3?'已批准':(deviceEntity.handoverStatus==4?'已备案':'已交付'))))}}</view>
		</view>
	</view>
</template>

<script>
	import {
		api,
		post
	} from '@/util/api.js'
	export default {
		props: {
			deviceId: ''
		},
		data() {
			return {
				deviceEntity: {}
			}
		},
		created() {
			this.querySingle()
		},
		methods: {
			querySingle() {
				post(api.DeviceSingle, {id: this.deviceId}).then(res => {
					this.deviceEntity = res.data
				})
			}
		}
	}
</script>


<style lang="scss" scoped>
	@import '@/static/css/DeviceBaseInfo.css';
</style>